//
//  CMDBFollowManager.swift
//  CMDB
//
//  Created by 王磊 on 17/4/8.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import UIKit

class CMDBFollowManager: NSObject {
    
    static let getInstance: CMDBFollowManager = CMDBFollowManager()
    
    private override init() {
        super.init()
        
    }
}
extension CMDBFollowManager: CMDBFollowManagerDelegate {}

extension CMDBFollowManager {
    
    func follow(followParam: CMDBFollowParam, handler: CMDBCommonHandler, error: CMDBHttpErrorHandler, failure: CMDBHttpFailureHandler) {
        
        CMDBHttpManager.getInstance.request(followParam.URLString(), param: followParam.keyValues, success: { (sysTime, data, page) in
            
            handler(isSuccess: true)
            
            }, error: error, failure: failure)
        
    }
    
    func cancleFollow(followParam: CMDBCancleFollowParam, handler: CMDBCommonHandler, error: CMDBHttpErrorHandler, failure: CMDBHttpFailureHandler) {
        
        CMDBHttpManager.getInstance.request(followParam.URLString(), param: followParam.keyValues, success: { (sysTime, data, page) in
            
            handler(isSuccess: true)
            
            }, error: error, failure: failure)
        
    }
}